package com.feng.annotation.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.feng.annotation.model.Employee;
import com.feng.annotation.service.EmployeeService;
import com.google.gson.Gson;

import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/employee")
public class EmployeeController {

    @Autowired
    private EmployeeService employeeService;

    @ApiOperation(value="测试接口1")
    @GetMapping("/getEmployeeList.do")
    public String getEmployeeList(){
    	List<Employee> employeeList = employeeService.getEmployeeList();
    	Gson gson = new Gson();
    	return gson.toJson(employeeList);
    }

    @ApiOperation(value="测试接口2")
    @RequestMapping("/getAllEmployee")
    public List<Employee> getAllEmployee(){
        return employeeService.getEmployeeList();
    }
    
}
